import {
	computed
} from 'vue'
import {
	request,
	retryableRequest
} from '@/common/request';
import {
	useUserStore
} from '@/stores/user.js'
const userType = computed(() => {
	return useUserStore().userType == 2 ? "b-agent-app/app" : "b-merchant-app/app"
})

export const complaintApi = {
	/**
	 * 分页列表
	 */
	page: (data) => {
		return request({
			url: `/${userType.value}/complaint/getComplaintPage`,
			data
		})
	},
	// 微信文件上传
	wechatUpload: (data) => {
		return request({
			url: `/${userType.value}/complaint/wechatUpload`,
			data
		})
	},
	// 微信回复用户
	wechatReply: (data) => {
		return request({
			url: `/${userType.value}/complaint/wechatReply`,
			data
		})
	},
	// 提交微信退款审批结果
	wechatRefund: (data) => {
		return request({
			url: `/${userType.value}/complaint/wechatRefund`,
			data
		})
	},
	// 微信反馈处理完成
	wechatComplete: (data) => {
		return request({
			url: `/${userType.value}/complaint/wechatComplete`,
			data
		})
	},
	// 微信投诉详情
	wechatDetail: (data) => {
		return request({
			url: `/${userType.value}/complaint/getWechatDetail`,
			data
		})
	},
	// 微信文件下载
	wechatDownload: (data) => {
		return request({
			url: `/${userType.value}/complaint/wechatDownload`,
			data
		})
	},
	// 微信协商历史
	getHistoryList: (data) => {
		return request({
			url: `/${userType.value}/complaint/getHistoryList`,
			data
		})
	},
	// 阿里图片上传
	aliUpload: (data) => {
		return request({
			url: `/${userType.value}/complaint/aliUpload`,
			data
		})
	},
	// 阿里商户在投诉中留言给用户
	aliReply: (data) => {
		return request({
			url: `/${userType.value}/complaint/aliReply`,
			data
		})
	},
	// 阿里处理消费者投诉单，提交处理结果
	aliProcessFinish: (data) => {
		return request({
			url: `/${userType.value}/complaint/aliProcessFinish`,
			data
		})
	},
	// 阿里小程序文件上传
	aliMiniUpload: (data) => {
		return request({
			url: `/${userType.value}/complaint/aliMiniUpload`,
			data
		})
	},
	// 阿里小程序商家补充凭证
	aliMiniSupplement: (data) => {
		return request({
			url: `/${userType.value}/complaint/aliMiniSupplement`,
			data
		})
	},
	// 阿里小程序商家留言回复
	aliMiniReply: (data) => {
		return request({
			url: `/${userType.value}/complaint/aliMiniReply`,
			data
		})
	},
	// 阿里小程序投诉详情（协商历史）
	aliMiniHistory: (data) => {
		return request({
			url: `/${userType.value}/complaint/aliMiniNegotiateHistory`,
			data
		})
	},
	// 阿里小程序商家处理交易投诉
	aliMiniFeedback: (data) => {
		return request({
			url: `/${userType.value}/complaint/aliMiniFeedback`,
			data
		})
	},
	// 阿里小程序商家处理交易投诉
	aliDetail: (data) => {
		return request({
			url: `/${userType.value}/complaint/aliDetail`,
			data
		})
	},
}